package com.xingchen.loveparttimejob.model.pojo;

import java.sql.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author lwj
 * @date 2024-12-03
 * @vesion 1.0.0
 */
public class TransactionHistory {
    /**
     * 交易记录编号
     */
    private int thId;
    /**
     * 连接用户表（外键）
     */
    private int uId;
    /**
     * 内容
     */
    private String content;
    /**
     * 交易金额
     */
    private String price;
    /**
     * 创建时间
     */
    private Date createTime;
    /**
     * 是否删除
     */
    private int state;

    // 构造方法
    public TransactionHistory() {}
    public TransactionHistory(int thId, int uId, String content, String price, Date createTime, int state) {
        this.thId = thId;
        this.uId = uId;
        this.content = content;
        this.price = price;
        this.createTime = createTime;
        this.state = state;
    }

    /**
     * 反射中使用到
     * @return
     */
    public Map<String,String> getMapping(){
        Map<String,String> map = new HashMap<>();
        map.put("thId","th_id");
        map.put("uId","u_id");
        map.put("content","content");
        map.put("price","price");
        map.put("createTime","create_time");
        map.put("state","state");
        return map;
    }

    // 属性
    public int getThId() {
        return thId;
    }

    public void setThId(int thId) {
        this.thId = thId;
    }

    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    /**
     * 打印交易记录表信息
     * @return
     */
    @Override
    public String toString() {
        return "TransactionHistory{" +
                "thId=" + thId +
                ", uId=" + uId +
                ", content='" + content + '\'' +
                ", price='" + price + '\'' +
                ", createTime=" + createTime +
                ", state=" + state +
                '}';
    }
}
